﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ServiceProcess;

namespace Sinacor.Infra.Tools.ErrorLogCollector
{
    [Serializable]
    public class ClientEnvironmentData
    {
        [XmlAttribute]
        public string OperationalSystem { get; set; }
        [XmlAttribute]
        public string Cpu { get; set; }
        [XmlAttribute]
        public long Memory { get; set; }

        [XmlAttribute]
        public string User { get; set; }
        [XmlAttribute]
        public string Computer { get; set; }
    }

    [Serializable]
    public enum ServiceProcessState
    {
        NotInstalled = 0,
        Stopped = 1,
        StartPending = 2,
        StopPending = 3,
        Running = 4,
        ContinuePending = 5,
        PausePending = 6,
        Paused = 7,
    }

    [Serializable]
    public class ServerEnvironmentData : ClientEnvironmentData
    {
        [XmlAttribute]
        public string DbVersion { get; set; }

        [XmlAttribute]
        public ServiceProcessState HosterServiceState { get; set; }
        [XmlAttribute]
        public ServiceProcessState ProcessManagerServiceState { get; set; }
        [XmlAttribute]
        public ServiceProcessState SinacorLoggingServiceState { get; set; }
        [XmlAttribute]
        public ServiceProcessState FixServiceState { get; set; }
        [XmlAttribute]
        public ServiceProcessState SinacorStsServiceState { get; set; }
    }
}
